'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.admin.home.index);
	
  // 后管api
  router.post('/adminUser/login', controller.admin.adminUser.login); // 登录
  router.post('/adminUser/logout', controller.admin.adminUser.logout); // 退出登录
  router.post('/adminUser/add', controller.admin.adminUser.add); // 添加用户
  router.get('/adminUser/userList', controller.admin.adminUser.userList); // 查询账户信息
  router.post('/adminUser/updateSheyinshi', controller.admin.adminUser.updatePwd); // 修改密码
  router.post('/adminUser/userDel', controller.admin.adminUser.userDel); // 账户信息删除
  
  router.post('/adminSheyinshi/add', controller.admin.adminSheyinshi.add); // 摄影师信息添加
  router.get('/adminSheyinshi/sheyinshiList', controller.admin.adminSheyinshi.sheyinshiList); // 查询摄影师信息信息
  router.post('/adminSheyinshi/update', controller.admin.adminSheyinshi.update); // 摄影师信息修改
  router.post('/adminSheyinshi/del', controller.admin.adminSheyinshi.del); // 摄影师信息删除
  
  // 摄影影集信息
  router.post('/adminYingji/add', controller.admin.adminYingji.add); 
  router.get('/adminYingji/dataList', controller.admin.adminYingji.dataList); 
  router.post('/adminYingji/update', controller.admin.adminYingji.update); 
  router.post('/adminYingji/del', controller.admin.adminYingji.del); 
  
  router.post('/adminRole/roleAdd', controller.admin.adminRole.roleAdd); // 添加角色
  
  // 文件上传
  router.post('/upload', controller.admin.common.upload); 
  
  // 服装类型
  router.post('/adminFuzhuang/add', controller.admin.adminFuzhuang.add); 
  router.get('/adminFuzhuang/dataList', controller.admin.adminFuzhuang.dataList); 
  router.post('/adminFuzhuang/update', controller.admin.adminFuzhuang.update); 
  router.post('/adminFuzhuang/del', controller.admin.adminFuzhuang.del); 
  
  // 订单管理
  router.post('/order/add', controller.admin.order.add);
  router.get('/order/dataList', controller.admin.order.dataList); 
  router.post('/order/update', controller.admin.order.update); 
  router.post('/order/del', controller.admin.order.del); 
  router.get('/order/userOrder', controller.admin.order.userOrder); 
	
  // -------------------------------------------------------------------------------------------------
  // 前台api
  router.post('/web/userAdd', controller.web.user.add); // 用户注册
  router.post('/web/login', controller.web.user.login); // 用户登录
  router.get('/web/userDataList', controller.web.user.dataList);
  router.post('/web/userUpdate', controller.web.user.update); 
  router.post('/web/userDel', controller.web.user.del); 
  
  
  
  router.get('/web/Fuzhuang', controller.web.fuzhuang.getData); // 服装数据类型查询
  router.get('/web/sheyinshi', controller.web.sheyinshi.getData); // 摄影师信息
  
  router.get('/web/userYingji', controller.web.userYingji.dataList); // 获取当前用户所属影集
};
